import {routerConfig } from './routerConfig';

// console.log(routerConfig);

let getInfo = function(routers, data) {
    let key = Object.keys(data)[0];
    let info;
    routers.forEach(item => {
        if (item[key] === data[key]) {
            info = Object.assign({}, item);
        } else {
            if (item.children) {
                let a = getInfo(item.children, data);
                if (a) {
                    info = a;
                }
            }
        }

    });
    return info;
};
let getRouterInfoByType = function(data) {
    return getInfo(routerConfig, data);
};
let dirList = {
    func_scrollScreen: 'components/views/pageSetting/scrollScreen',
    func_signIn: 'components/views/pageSetting/signInDetail',
    func_prizeDraw: 'components/views/pageSetting/prizeDraw',
    func_loopPlay: 'components/views/pageSetting/loopPlay',
    func_userDefined: 'components/views/pageSetting/userDefined',
};
export { getRouterInfoByType, dirList };